package com.yanqu.road.logic.pb;

import com.yanqu.road.entity.activity.feast.data.CrossFeastPvpUserData;
import com.yanqu.road.entity.activity.feast.data.FeastPveSampleData;
import com.yanqu.road.entity.activity.feast.data.FeastUserData;
import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.pb.activity.ShanHeFeastProto;

public class CrossShanHeFeastPb {

    public static ShanHeFeastProto.FeastPveSampleTemp.Builder parsePveSampleTemp(UserBaseInfo userBaseInfo, FeastUserData FeastUserData){
        ShanHeFeastProto.FeastPveSampleTemp.Builder builder = ShanHeFeastProto.FeastPveSampleTemp.newBuilder();
        builder.setName(userBaseInfo.getNickName());
        builder.setServerId(userBaseInfo.getServerId());
        builder.setUserId(FeastUserData.getUserId());
        builder.setImageId(FeastUserData.getImageId());
        builder.setStateId(FeastUserData.getStateId());
        builder.setPracticeSpeed(FeastUserData.getPracticeSpeed());
        builder.setSectId(FeastUserData.getSectId());
        return builder;
    }

    public static ShanHeFeastProto.FeastPveSampleTemp.Builder parsePveSampleTemp(FeastPveSampleData sampleData){
        ShanHeFeastProto.FeastPveSampleTemp.Builder builder = ShanHeFeastProto.FeastPveSampleTemp.newBuilder();
        builder.setName(sampleData.getName());
        builder.setServerId(sampleData.getServerId());
        builder.setUserId(sampleData.getUserId());
        builder.setImageId(sampleData.getImageId());
        builder.setStateId(sampleData.getStateId());
        builder.setPracticeSpeed(sampleData.getPracticeSpeed());
        builder.setSectId(sampleData.getSectId());
        return builder;
    }

    public static FeastPveSampleData parseToPveSampleData(ShanHeFeastProto.FeastPveSampleTemp msg){
        FeastPveSampleData sampleData = new FeastPveSampleData();
        sampleData.setServerId(msg.getServerId());
        sampleData.setUserId(msg.getUserId());
        sampleData.setImageId(msg.getImageId());
        sampleData.setName(msg.getName());
        sampleData.setStateId(msg.getStateId());
        sampleData.setPracticeSpeed(msg.getPracticeSpeed());
        sampleData.setSectId(msg.getSectId());
        return sampleData;
    }

    public static ShanHeFeastProto.FeastPveSampleTemp.Builder parsePveSampleTemp(UserBaseInfo userBaseInfo, CrossFeastPvpUserData FeastUserData){
        ShanHeFeastProto.FeastPveSampleTemp.Builder builder = ShanHeFeastProto.FeastPveSampleTemp.newBuilder();
        builder.setName(userBaseInfo.getNickName());
        builder.setServerId(userBaseInfo.getServerId());
        builder.setUserId(FeastUserData.getUserId());
        builder.setImageId(FeastUserData.getPveProperty().getImageId());
        builder.setStateId(FeastUserData.getPveProperty().getStateId());
        builder.setPracticeSpeed(FeastUserData.getPveProperty().getPracticeSpeed());
        builder.setSectId(FeastUserData.getCampId());
        return builder;
    }
}
